package service

import (
	"beetle/dao"
	"encoding/json"
	"fmt"
)

type User struct {
	//	err errors
}

func (this User) GetUserAndToJson(id int) []byte {
	var UserDao dao.User
	user, err := UserDao.GetUserById(id)
	if err != nil {
		fmt.Printf("get user err:%v\n", err)
	}
	jsons, errs := json.Marshal(user)
	if errs != nil {
		fmt.Println("json marshal error:", errs)
	}
	return jsons
}
